package com.ignou.mca.datasource;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class DatabaseConnectionManager
{
	public static Connection getConnection()
	{
		Connection conn = null;
		String userName = "root";
        String password = "root";
        String url = "jdbc:mysql://localhost:3306/oes";
        try {
			Class.forName ("com.mysql.jdbc.Driver");
			conn = DriverManager.getConnection(url, userName, password);
		} catch (ClassNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
        
        System.out.println ("Connection created");
        return conn;
	}
}